/// <reference path="../../../../../node_modules/@types/underscore/index.d.ts" />
import {Component, OnInit} from '@angular/core';
import {Menu} from './menu-item/menu-item.component';
import {pxToRem, widthSpread} from '../../../../ng-tools';
import {MenuService} from '../../../services/api/menu.service';
import {UserService} from '../../../services/api/user.service';
import {ThemeService} from '../../../services/theme.service';


export const widthSpreadTrigger = widthSpread(pxToRem(50), pxToRem(250), '200ms ease-out');


@Component({
  selector: 'app-menu',
  templateUrl: './menu.component.html',
  styleUrls: ['./menu.component.scss'],
  animations: [
    widthSpreadTrigger
  ]
})
export class MenuComponent implements OnInit {

  stateExpression = 'start';

  public menus = [
    {
      bold: true,
      css_icon: 'fa fa-fw fa-wrench',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/system-set/',
      name: '系统配置',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-television',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/system/',
      name: '平台信息',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-user-circle-o',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/user/',
      name: '用户管理',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-jpy',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/charge/',
      name: '充值管理',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-list',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/charge-log/',
      name: '充值记录',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-credit-card',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/money/',
      name: '提现管理',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-th-list',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/money-log/',
      name: '提现记录',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-gamepad',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/game-group/',
      name: '游戏群',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-podcast',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/personal-group/',
      name: '私人群',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-android',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/robot-group/',
      name: '机器人组',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-reddit-alien',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/robot-manager/',
      name: '机器人管理',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-bar-chart',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/platform-statistic/',
      name: '平台统计',
      sub_menu: [],
      supers: [],
    },
    {
      bold: true,
      css_icon: 'fa fa-fw fa-gg-circle',
      expandable: false,
      father: null,
      id: 20000,
      leaf_node: false,
      link: 'oplatform/charge-style/',
      name: '充值分类',
      sub_menu: [],
      supers: [],
    },
  ];

  constructor(
    private user: UserService,
    public theme: ThemeService,
  ) {
  }

  ngOnInit() {
    // this.user.menuObserver().subscribe(menu => {
    //   this.menus = menu.tree;
    // });
  }

  showMenu(): void {
    this.stateExpression = 'end';
  }

  hideMenu(): void {
    this.stateExpression = 'start';
  }
}


